import myconfig
Import('PRJ_ROOT')
from building import *
import os
import shutil
# get current directory
cwd = GetCurrentDir()
path = [cwd,
cwd+'/porting',
cwd+'/src',
cwd+'/src/core',
cwd+'/src/draw',
cwd+'/src/extra',
cwd+'/src/font',
cwd+'/src/gpu',
cwd+'/src/hal',
cwd+'/src/misc',
cwd+'/src/widgets',
cwd+'/src/extra/layouts',
cwd+'/src/extra/themes',
cwd+'/src/extra/widgets',
cwd+'/src/extra/widgets',]
# The set of source files associated with this SConscript file.
src = Split("""
porting/lv_port_disp.c
porting/lv_port_fs.c
porting/lv_port_indev.c
src/core/lv_disp.c
src/core/lv_event.c
src/core/lv_group.c
src/core/lv_indev.c
src/core/lv_indev_scroll.c
src/core/lv_obj.c
src/core/lv_obj_class.c
src/core/lv_obj_draw.c
src/core/lv_obj_pos.c
src/core/lv_obj_scroll.c
src/core/lv_obj_style.c
src/core/lv_obj_style_gen.c
src/core/lv_obj_tree.c
src/core/lv_refr.c
src/core/lv_theme.c
src/draw/lv_draw_arc.c
src/draw/lv_draw_blend.c
src/draw/lv_draw_img.c
src/draw/lv_draw_label.c
src/draw/lv_draw_line.c
src/draw/lv_draw_mask.c
src/draw/lv_draw_rect.c
src/draw/lv_draw_triangle.c
src/draw/lv_img_buf.c
src/draw/lv_img_cache.c
src/draw/lv_img_decoder.c
src/extra/lv_extra.c
src/extra/layouts/flex/lv_flex.c
src/extra/layouts/grid/lv_grid.c
src/extra/themes/basic/lv_theme_basic.c
src/extra/themes/default/lv_theme_default.c
src/extra/themes/mono/lv_theme_mono.c
src/extra/widgets/animimg/lv_animimg.c
src/extra/widgets/calendar/lv_calendar.c
src/extra/widgets/calendar/lv_calendar_header_arrow.c
src/extra/widgets/calendar/lv_calendar_header_dropdown.c
src/extra/widgets/chart/lv_chart.c
src/extra/widgets/colorwheel/lv_colorwheel.c
src/extra/widgets/imgbtn/lv_imgbtn.c
src/extra/widgets/keyboard/lv_keyboard.c
src/extra/widgets/led/lv_led.c
src/extra/widgets/list/lv_list.c
src/extra/widgets/meter/lv_meter.c
src/extra/widgets/msgbox/lv_msgbox.c
src/extra/widgets/span/lv_span.c
src/extra/widgets/spinbox/lv_spinbox.c
src/extra/widgets/spinner/lv_spinner.c
src/extra/widgets/tabview/lv_tabview.c
src/extra/widgets/tileview/lv_tileview.c
src/extra/widgets/win/lv_win.c
src/font/lv_font.c
src/font/lv_font_fmt_txt.c
src/font/lv_font_loader.c
src/font/lv_font_montserrat_10.c
src/font/lv_font_montserrat_12.c
src/font/lv_font_montserrat_12_subpx.c
src/font/lv_font_montserrat_14.c
src/font/lv_font_montserrat_16.c
src/font/lv_font_montserrat_18.c
src/font/lv_font_montserrat_20.c
src/font/lv_font_montserrat_22.c
src/font/lv_font_montserrat_24.c
src/font/lv_font_montserrat_26.c
src/font/lv_font_montserrat_28.c
src/font/lv_font_montserrat_28_compressed.c
src/font/lv_font_montserrat_30.c
src/font/lv_font_montserrat_32.c
src/font/lv_font_montserrat_34.c
src/font/lv_font_montserrat_36.c
src/font/lv_font_montserrat_38.c
src/font/lv_font_montserrat_40.c
src/font/lv_font_montserrat_42.c
src/font/lv_font_montserrat_44.c
src/font/lv_font_montserrat_46.c
src/font/lv_font_montserrat_48.c
src/font/lv_font_montserrat_8.c
src/font/lv_font_simsun_16_cjk.c
src/font/lv_font_unscii_16.c
src/font/lv_font_unscii_8.c
src/gpu/lv_gpu_nxp_pxp.c
src/gpu/lv_gpu_nxp_pxp_osa.c
src/gpu/lv_gpu_nxp_vglite.c
src/gpu/lv_gpu_stm32_dma2d.c
src/hal/lv_hal_disp.c
src/hal/lv_hal_indev.c
src/hal/lv_hal_tick.c
src/misc/lv_anim.c
src/misc/lv_area.c
src/misc/lv_async.c
src/misc/lv_bidi.c
src/misc/lv_color.c
src/misc/lv_fs.c
src/misc/lv_gc.c
src/misc/lv_ll.c
src/misc/lv_log.c
src/misc/lv_math.c
src/misc/lv_mem.c
src/misc/lv_printf.c
src/misc/lv_style.c
src/misc/lv_style_gen.c
src/misc/lv_templ.c
src/misc/lv_timer.c
src/misc/lv_tlsf.c
src/misc/lv_txt.c
src/misc/lv_txt_ap.c
src/misc/lv_utils.c
src/widgets/lv_arc.c
src/widgets/lv_bar.c
src/widgets/lv_btn.c
src/widgets/lv_btnmatrix.c
src/widgets/lv_canvas.c
src/widgets/lv_checkbox.c
src/widgets/lv_dropdown.c
src/widgets/lv_img.c
src/widgets/lv_label.c
src/widgets/lv_line.c
src/widgets/lv_objx_templ.c
src/widgets/lv_roller.c
src/widgets/lv_slider.c
src/widgets/lv_switch.c
src/widgets/lv_table.c
src/widgets/lv_textarea.c
""")
if GetDepend(['LITTLEVGL_LCD_ST7789']) and GetDepend(['LITTLEVGL_MCU_HC32F4X0']):
    shutil.copy(cwd+'\\porting\\lv_port_disp_st7789_hc32f4x0.c',cwd+'\\porting\\lv_port_disp.c')
    src+=["lcd/st7789/hc32f4x0/bsp_tft_st7789.c"]
    path+=[cwd+'/lcd/st7789/hc32f4x0']
elif GetDepend(['LITTLEVGL_LCD_ST7789']) and GetDepend(['LITTLEVGL_MCU_STM32F10X']):
    shutil.copy(cwd+'\\porting\\lv_port_disp_st7789_stm32f10x.c',cwd+'\\porting\\lv_port_disp.c')
    src+=["lcd/st7789/stm32f10x/bsp_tft_st7789.c"]
    path+=[cwd+'/lcd/st7789/stm32f10x']
else:
    shutil.copy(cwd+'\\porting\\lv_port_disp_default.c',cwd+'\\porting\\lv_port_disp.c')

group = DefineGroup('littleVGL', src, depend = [''], CPPPATH = path)

Return('group')